package com.error.service.impl;

import com.error.ResponseCodeEnum;
import com.error.UserException;
import com.error.service.UserInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * @Auther: zwg
 * @Date: 2019/3/5 09:33
 * @Description:
 */
@Service
public class UserInfoServiceIpml implements UserInfoService {

    private final Logger logger = LoggerFactory.getLogger(UserInfoServiceIpml.class);

    @Override
    public String getUserName(Integer userId) {
        try{
            if(userId<10) {
                throw new UserException(ResponseCodeEnum.GET_USER_INFO_FAILED);
            }
        }catch (UserException e) {
            logger.error("操作异常请检查：{}",e);
        }
        return null;
    }
}
